/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package server.entities;

import java.io.Serializable;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author efim
 */
@Entity
@XmlRootElement
public class Transaction implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.TABLE)
    private Long id;

    public Long getId() {
        return id;
    }
    @XmlElement
    public void setId(Long id) {
        this.id = id;
    }

    private String name;

    /**
     * Get the value of name
     *
     * @return the value of name
     */
    public String getName() {
        return name;
    }

    /**
     * Set the value of name
     *
     * @param name new value of name
     */
    @XmlElement
    public void setName(String name) {
        this.name = name;
    }
    
        private long accountId;

    /**
     * Get the value of accountId
     *
     * @return the value of accountId
     */
    public long getAccountId() {
        return accountId;
    }

    /**
     * Set the value of accountId
     *
     * @param accountId new value of accountId
     */
    @XmlElement
    public void setAccountId(long accountId) {
        this.accountId = accountId;
    }



    
    private double amount;

    /**
     * Get the value of amount
     *
     * @return the value of amount
     */
    public double getAmount() {
        return amount;
    }

    /**
     * Set the value of amount
     *
     * @param amount new value of amount
     */
    @XmlElement
    public void setAmount(double amount) {
        this.amount = amount;
    }
    
        private Long transactionTypeId;

    /**
     * Get the value of transactionTypeId
     *
     * @return the value of transactionTypeId
     */
    public Long getTransactionTypeId() {
        return transactionTypeId;
    }

    /**
     * Set the value of transactionTypeId
     *
     * @param transactionTypeId new value of transactionTypeId
     */
    @XmlElement
    public void setTransactionTypeId(Long transactionTypeId) {
        this.transactionTypeId = transactionTypeId;
    }



    private long dateEdit;

    /**
     * Get the value of dateEdit
     *
     * @return the value of dateEdit
     */
    public long getDateEdit() {
        return dateEdit;
    }

    /**
     * Set the value of dateEdit
     *
     * @param dateEdit new value of dateEdit
     */
    @XmlElement
    public void setDateEdit(long dateEdit) {
        this.dateEdit = dateEdit;
    }


    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Transaction)) {
            return false;
        }
        Transaction other = (Transaction) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "entities.Transaction[ id=" + id + " ]";
    }
    
}
